#include <bits/stdc++.h>
using namespace std;

class Solution
{
  public:
    vector<string> Solve(string &version)
    {
        string tmp;
        stringstream s(version);
        vector<string> ans;
        while (getline(s, tmp, '.'))
        {
            ans.push_back(tmp);
        }
        return ans;
    }
    int compare(string version1, string version2)
    {
        // write code here
        vector<string> v1 = Solve(version1);
        vector<string> v2 = Solve(version2);
        size_t maxLength = max(v1.size(), v2.size());
        for (size_t i = 0; i < maxLength; i++)
        {
            if (i >= v1.size())
            {
                int num2 = stoi(v2[i]);
                if (num2)
                    return -1;
            }
            else if (i >= v2.size())
            {
                int num1 = stoi(v1[i]);
                if (num1)
                    return 1;
            }
            else
            {
                int num1 = stoi(v1[i]);
                int num2 = stoi(v2[i]);
                if (num1 > num2)
                    return 1;
                else if (num1 < num2)
                    return -1;
            }
        }
        return 0;
    }
};